package com.lanxiao.cloud.modules.user.application.dto;

import com.lanxiao.cloud.common.core.dto.Dto;
import com.lanxiao.cloud.common.core.enums.SexEnum;
import com.lanxiao.cloud.common.core.enums.StateEnum;
import com.lanxiao.cloud.common.core.utils.StringUtils;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.Date;

/**
 * @author ：qiaoliang
 * @date ：2021-09-14
 */
@ApiModel("分页查询部门用户信息返回模型")
public class UserDeptPageDto extends Dto<Long> {
  @ApiModelProperty("昵称")
  private final String name;
  @ApiModelProperty("头像")
  private final String portrait;
  @ApiModelProperty("性别")
  private final SexEnum sex;
  @ApiModelProperty("手机号")
  private final String phone;

  public UserDeptPageDto(Long id, String name, String portrait,
      SexEnum sex, String phone) {
    super(id);
    this.name = name;
    this.portrait = portrait;
    this.sex = sex;
    this.phone = phone;
  }

  public String getName() {
    return name;
  }

  public String getPortrait() {
    return portrait;
  }

  public SexEnum getSex() {
    return sex;
  }

  public String getPhone() {
    return StringUtils.isNotBlank(phone)?
        phone.replaceAll("(\\d{3})\\d{4}(\\d{4})", "$1****$2"):
        phone;
  }
}
